<?php
/**
 * @ Fmash Top System
 * @ version: 3.0
 * @ author: i.coffee.smile@mail.com
 * @ date:2011-1-28
 * @ file:member.php $19
 */

include_once 'class_mysql.php';
include_once 'function.php';

$member_uid = isnum($_GET['uid']);

$member_sql = "SELECT `fav`,`name`,`lastdate` FROM `$top_member` WHERE `uid`='$member_uid'";
$member_result = mysql_query($member_sql);
$member_row = mysql_fetch_row($member_result);
$member_name = $member_row[1];
$member_last = date("Y-m-d",$member_row[2]);
$bz = 0;
if($member_name != '')
{
	if($member_row[0]==''){
		$empty = 1;
		break;
	}else{
		$exp_fav = explode("|",$member_row[0]);
		for($i=0,$favLen=count($exp_fav);$i<$favLen;$i++)
		{
			$expfav = explode(",",$exp_fav[$i]);
			$favArr[] = array('uid'=>$expfav[0],'name'=>$expfav[1],'show'=>$expfav[2]);
			$uidArr[] = $favArr[$i]['uid'];
			$nameArr[] = $favArr[$i]['name'];
			$showArr[] = $favArr[$i]['show'];
		}	
	}
}else{
	$bz = 1;
	$message = "暂时没有喜欢任何人！";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
    
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>
            <?php echo $member_name;?> 个人空间 - 吉首大学网络社区
        </title>
        <link href="style/mainv.css" media="screen" rel="stylesheet"
        type="text/css" />
        <link href="style/stylev.css" media="screen" rel="stylesheet"
        type="text/css" />
        <link type="image/x-icon" rel="shortcut icon" href="http://www.topit.me/favicon.ico"
        />
    </head>
    
    <body>
        <?php include_once('header.template');?>
        <div id="wrapper">
            <div id="wrapper-inner">
                <div id="sidebar">
                    <div class="box userinfo">
                        <a href="http://www.fmash.com/home.php?mod=space&uid=<?php echo $member_uid;?>">
                            <img src="<?php get_avatar($member_uid,big);?>" />
                        </a>
                        <div class="userinfo_blk">
                            <h2>
                                <?php echo $member_name;?> 
                            </h2>
                            <p>
                            最后登录:<br/>
                                <a href="#">
                                    <span>
                                        <?php echo $member_last;?>
                                    </span>
                                </a>
                                
                            </p>
                        </div>
                    </div>

                </div>
                <div id="canvas">
                    <div id="content">
                        <div class="pageheader">
                            <h2>
                                <?php echo $member_name;?> 
                            </h2>
                            <div class="right">
                                <ul class="tabs">
                                    <li class="active">
                                        <a href="#">
                                            喜欢的人
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="clear">
                        </div>
                        <div class="catalog">
                        <?php 
						if($bz == 1){
							echo $message;
						}else{
						$favlen = count($exp_fav)<30?count($exp_fav):30;
						for($i=0;$i<$favLen;$i++)
						{
							?>
                            <a title="<?php echo $nameArr[$i];?>" href="./?<?php echo $uidArr[$i];?>">
                                <img id="item_drag" class="img" width="100px" height="100px" title="<?php echo $nameArr[$i];?>"
                                src="show/<?php echo $showArr[$i];?>" />
                            </a>
                            <?php
							
							}}
						    ?>
                            <div class="clear">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="clear">
                </div>
            </div>
        </div>
       <?php include_once("footer.template");?>
    </body>
</html>